Skip to content

Conversation

TarunAdobe
Copy link
Contributor

@TarunAdobe TarunAdobe commented Oct 7, 2025

Description

  • Added build-, test-, start-, and lint- root scripts so first- and second-gen workspaces can be orchestrated together.
  • Introduced a prebuild wireit target in first-gen/package.json that triggers the second-gen core build before the existing build pipeline.
  • Renamed the second-gen workspace to @adobe/swc and updated yarn.lock to reflect the new package name.

Motivation and context

  • Make the root package the single entry point for common dev workflows that span both generations of Spectrum Web Components.
  • Ensure first-gen builds automatically compile second-gen core artifacts to keep shared output in sync.

Related issue(s)

  • fixes [Issue Number]

Screenshots (if appropriate)


Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features
  • Automated tests cover all use cases and follow best practices for writing
  • Validated on all supported browsers
  • All VRTs are approved before the author can update Golden Hash

Manual review test cases

  1. Build Pipeline (First-gen and Second-gen)

    • Test: Run yarn build at the repo root.
    • Goal: Ensure both first-gen and second-gen workspaces build successfully and in the correct order.
    • Check: No errors in the build output. Artifacts for both generations are correctly produced.
  2. Test Scripts

    • Test: Run yarn test, yarn test-first-gen, and yarn test-second-gen at the root.
    • Goal: All tests in both generations (unit, integration, etc.) must pass.
    • Check: Look for failures in either workspace.
  3. Linting

    • Test: Run yarn lint, yarn lint-first-gen, and yarn lint-second-gen.
    • Goal: Linting completes without errors for both codebases.
    • Check: Confirm the new shared ESLint config is applied and that there are no unexpected warnings or errors.
  4. Wireit Integration

    • Test: Run yarn workspace @adobe/spectrum-web-components build (or the specific first-gen build command).
    • Goal: The new prebuild Wireit script should reliably trigger the second-gen build as a dependency.
    • Check: No race conditions or missed dependencies; confirm that changes in second-gen core trigger rebuilds as expected.
  5. CI/CD

    • Test: Monitor all automated build and test jobs in your CI (e.g., GitHub Actions, Jenkins).
    • Goal: All jobs pass after merging these changes.
    • Check: Especially watch for any failures in composite builds or jobs that run the changed scripts.

Device review

  • Did it pass in Desktop?
  • Did it pass in (emulated) Mobile?
  • Did it pass in (emulated) iPad?

Copy link

changeset-bot bot commented Oct 7, 2025

⚠️ No Changeset found

Latest commit: 1f1e69e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Oct 7, 2025

📚 Branch Preview

🔍 Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-5791

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

Copy link
Contributor

github-actions bot commented Oct 7, 2025

Tachometer results

Currently, no packages are changed by this PR...

@TarunAdobe TarunAdobe changed the title chore: hoist dev commands to root packagejson chore: command orchestration Oct 7, 2025
@TarunAdobe TarunAdobe marked this pull request as ready for review October 8, 2025 05:54
@TarunAdobe TarunAdobe requested a review from a team as a code owner October 8, 2025 05:54
@TarunAdobe TarunAdobe self-assigned this Oct 8, 2025
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would start also require yarn run dev on core?

"clean": "yarn workspaces foreach --from '@swc/*' --recursive run clean",
"lint": "eslint . --ext .ts,.js,.json",
"storybook": "yarn workspace @swc/components storybook",
"start": "yarn workspace @swc/components storybook",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, wouldn't this also depend on core running in dev mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn start needs yarn build and yarn build will build the core as well as the second-gen/first-gen depending on what is required and that's enough to run the storybook

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but without core running with HMR, it means changes made to any core file won't be hot-reloaded in Storybook.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may also want to get the CEM analyzer to run in --watch mode, because we will want getStorybookHelpers to automatically reflect the changes to the component.

"scripts": {
"build": "yarn workspaces foreach --from '@swc/*' run build",
"clean": "yarn workspaces foreach --from '@swc/*' run clean",
"build": "yarn workspaces foreach --from '@swc/*' --recursive run build",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will force Yarn to traverse downstream dependents, rebuilding or cleaning even when nothing changed. Is this what we need? We can do caching or parallelisation here too. Let me know your setup

"build": "yarn workspaces foreach --from '@swc/*' run build",
"clean": "yarn workspaces foreach --from '@swc/*' run clean",
"build": "yarn workspaces foreach --from '@swc/*' --recursive run build",
"clean": "yarn workspaces foreach --from '@swc/*' --recursive run clean",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you just want to delete the SWC output you can avoid the cascading clean. You can just run this?

yarn workspaces foreach --from '@swc/*' run clean

package.json Outdated
Comment on lines 18 to 20
"build-first-gen": "yarn workspace @adobe/spectrum-web-components build",
"build-second-gen": "yarn workspace @adobe/swc build",
"build": "yarn build-first-gen && yarn build-second-gen",
Copy link
Collaborator

@marissahuysentruyt marissahuysentruyt Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is strictly a curiosity I had: can you explain why you chose build-first-gen over something like build:first-gen? I've just seen the colon syntax more often, that's all.

Sort of along these lines, if we went with the colon syntax instead, could we do something like:

"build": "yarn build:*",

Why does the order of building first-gen or second-gen matter? I honestly don't know what order something like yarn build:* would build each project, so maybe this is not even a good idea or feasible! 😆

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the first part, It was an oversight on my end. I feel its better to use build:first-gen and so I switched that up. And about the second one, no the order of building first-gen or second-gen doesn't matter as long as both are being built before starting their respective storybooks.

@marissahuysentruyt
Copy link
Collaborator

Just wanted to leave some notes as I was walking through the validation steps.

For yarn build:
I am getting build errors (for second-gen), but they're not enough for me not to run either project. Were you getting those at all? 🤔 Maybe they're known or acceptable errors for now.

Screenshot 2025-10-15 at 1 38 17 PM

For yarn test:

the new first-gen and second-gen commands work from the root, and yarn test fires off both with no problems. 🥳
Screenshot 2025-10-15 at 1 48 00 PM
Screenshot 2025-10-15 at 1 55 52 PM
Screenshot 2025-10-15 at 1 55 38 PM

WireIt and workspace commands
First-gen and second-gen can be run with their corresponding Storybook start commands. 👍

For yarn lint:
For second-gen, I get the eslint command is not found error. First-gen I think is working- it output where I made changes correctly (to be honest, I don't remember what the output typically looks like for linting on main)

Screenshot 2025-10-15 at 2 33 33 PM Screenshot 2025-10-15 at 2 33 22 PM Screenshot 2025-10-15 at 2 36 04 PM

I don't think this is related to this PR or not, but when I run yarn build from the root (after running nvm use && git clean -dfX && yarn), I do get a message that Vite requires nvm version 20.19+, but our .nvmrc only has nvm at 20.13.1. Is that something we would want to address at some point?
Screenshot 2025-10-15 at 2 13 57 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants